import request from '@/utils/request'

// 课程分页查询
export function courseList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/pageList',
    method: 'get',
    params: query
  })
}

// 课程下架
export function courseDown(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/down',
    method: 'get',
    params: query
  })
}

// 课程上架
export function coursePutOn(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/up',
    method: 'get',
    params: query
  })
}

// 课程推广码
export function QRcode(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/QRcode',
    method: 'get',
    params: query
  })
}

// 根据课程编号查询套餐
export function getByCourseId(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/setmeal/getByCourseId',
    method: 'get',
    params: query
  })
}

// 课程套餐-新增
export function courseSetmealAdd(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/setmeal/add',
    method: 'post',
    data: query
  })
}
// 课程套餐-编辑
export function courseSetmealUpdateById(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/setmeal/updateById',
    method: 'post',
    data: query
  })
}
// 课程套餐-删除
export function courseSetmealDeleteById(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/setmeal/deleteById',
    method: 'get',
    params: query
  })
}

// 删除课程
export function deleteCourse(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/deleteById',
    method: 'get',
    params: query
  })
}

// 查询单个课程（含协议和套餐）
export function getBoById(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/getBoById',
    method: 'get',
    params: query
  })
}

// 课程标签查询
export function courseLabelList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/courseLabel/list',
    method: 'get',
    params: query
  })
}

// 课程性质分页查询
export function courseNatureList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/nature/pageList',
    method: 'get',
    params: query
  })
}

// 课程分页查询
export function courseCategoryList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/getBusinessById',
    method: 'get',
    params: query
  })
}

// 根据编号查询分校
export function businessList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/getChildBus',
    method: 'get',
    params: query
  })
}

// 获取年级集合
export function courseGradeList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/courseGrade/list',
    method: 'get',
    params: query
  })
}

// 获取机构老师
export function getTeachers(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/getTeachers',
    method: 'get',
    params: query
  })
}

// 新增课程（含协议和套餐）
export function addCourse(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/addBO',
    method: 'post',
    data: query
  })
}

// 修改课程（含协议和套餐）
export function updateCourse(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/update',
    method: 'post',
    data: query
  })
}
